<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="description" content="初步进入linux世界"/>
    <meta name="keywords"
          content="nginx,freebsd,linux,mysql,shell,apache,centos,redhat,rhel,windows,sql,系统运维,IT运维,开源系统,开源系统运维"/>

</head>
<body>
<div id="menu">
    <ul>
		<span style="FONT-SIZE: 10.5pt">
			<li><a href="index.htm" hidefocus="true" id="mn_list">linux入门教程</a></li>
		</span>
    </ul>
</div>
<p style="TEXT-ALIGN: center"><span style="FONT-SIZE: 15pt; FONT-FAMILY: '宋体'"><b>第四章</b></span><span
        style="FONT-SIZE: 15pt;"><b> </b></span><span style="FONT-SIZE: 15pt; FONT-FAMILY: '宋体'"><b>初步进入</b></span><span
        style="FONT-SIZE: 15pt;"><b>linux</b></span><span style="FONT-SIZE: 15pt; FONT-FAMILY: '宋体'"><b>世界</b></span>
</p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">【</span><span
        style="FONT-SIZE: 10.5pt;"><b>Linux </b></span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'"><b>系统启动过程</b></span><span
        style="FONT-SIZE: 10.5pt;">】</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Linux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">的启动其实和</span><span style="FONT-SIZE: 10.5pt;">windows</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">的启动过程很类似，不过</span><span
        style="FONT-SIZE: 10.5pt;">windows</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">我们是无法看到启动信息的，而</span><span
        style="FONT-SIZE: 10.5pt;">linux</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">启动时我们会看到许多启动信息，例如某个服务是否启动</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Linux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">系统的启动过程大体上可分为五部分：内核的引导；运行</span><span style="FONT-SIZE: 10.5pt;">init</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">；系统初始化；建立终端</span><span style="FONT-SIZE: 10.5pt;"> </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">；用户登录系统</span><span style="FONT-SIZE: 10.5pt;">。</span></p>

<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><b>A </b></span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'"><b>内核引导</b></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"></span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">当计算机打开电源后，首先是</span><span
        style="FONT-SIZE: 10.5pt;">BIOS</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">开机自检，按照</span><span
        style="FONT-SIZE: 10.5pt;">BIOS</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">中设置的启动设备（通常是硬盘）来启动</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">紧接着由启动设备上的</span><span
        style="FONT-SIZE: 10.5pt;">grub</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">程序开始引导</span><span
        style="FONT-SIZE: 10.5pt;">linux</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">当引导程序成功完成引导任务后，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">Linux</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">从它们手中接管了</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">CPU</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的控制权，然后</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">CPU</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">就开始执行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">Linux</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的核心映象代码，开始了</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">Linux</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">启动过程</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">也就是所谓的内核引导开始了，在内核引导过程中其实是很复杂的，我们就当它是一个黑匣子，反正是</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">linux</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">内核做了一些列工作，最后内核调用加载了</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">init</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序，至此内核引导的工作就完成了</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">交给了下一个主角</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">init。</span></p>
<p style="TEXT-ALIGN: justify"><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><b>B </b></span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'"><b>运行</b></span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><b>init</b></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">init </span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">进程是系统所有进程的起点，你可以把它比拟成系统所有进程的老祖宗，没有这个进程，系统中任何进程都不会启动</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。init </span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序首先是需要读取配置文件</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"> /etc/inittab。inittab</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">是一个不可执行的文本文件，它有若干行指令所组成</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">具体内容如下：（你可以在你的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">linux</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">上执行命令</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"> cat /etc/inittab </span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">这样获得）</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">　　# inittab&nbsp; &nbsp;&nbsp; &nbsp; This file describes how the INIT process should set up<br>　　#&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;the system in a certain run-level.<br>　　#<br>　　# Author:&nbsp; &nbsp;&nbsp; &nbsp; Miquel van Smoorenburg,<br>　　#&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;Modified for RHS Linux by Marc Ewing and Donnie Barnes<br>　　#<br>　　# Default runlevel. The runlevels used by RHS are:<br>　　#&nbsp; &nbsp;0 - halt (Do NOT set initdefault to this)<br>　　#&nbsp; &nbsp;1 - Single user mode<br>　　#&nbsp; &nbsp;2 - Multiuser, without NFS (The same as 3, if you do not havenetworking)<br>　　#&nbsp; &nbsp;3 - Full multiuser mode<br>　　#&nbsp; &nbsp;4 - unused<br>　　#&nbsp; &nbsp;5 - X11<br>　　#&nbsp; &nbsp;6 - reboot (Do NOT set initdefault to this)<br>　　#<br>　　###</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">表示当前缺省运行级别为</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">5(initdefault)</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">；</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><br>　　id:5:initdefault:<br>　　###</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">启动时自动执行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/rc.d/rc.sysinit</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">脚本</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">(sysinit)<br>　　# System initialization.<br>　　si::sysinit:/etc/rc.d/rc.sysinit<br>　　l0:0:wait:/etc/rc.d/rc 0<br>　　l1:1:wait:/etc/rc.d/rc 1<br>　　l2:2:wait:/etc/rc.d/rc 2<br>　　l3:3:wait:/etc/rc.d/rc 3<br>　　l4:4:wait:/etc/rc.d/rc 4<br>　　###</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">当运行级别为</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">5</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">时，以</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">5</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">为参数运行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/rc.d/rc</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">脚本，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">init</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">将等待其返回</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">(wait)<br>　　l5:5:wait:/etc/rc.d/rc 5<br>　　l6:6:wait:/etc/rc.d/rc 6<br>　　###</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">在启动过程中允许按</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">CTRL-ALT-DELETE</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">重启系统</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><br>　　# Trap CTRL-ALT-DELETE<br>　　ca::ctrlaltdel:/sbin/shutdown -t3 -r now<br>　　# When our UPS tells us power has failed, assume we have a few minutes<br>　　# of power left.&nbsp;&nbsp;Schedule a shutdown for 2 minutes from now.<br>　　# This does, of course, assume you have powerd installed and your<br>　　# UPS connected and working correctly.<br>　　pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"<br>　　# If power was restored before the shutdown kicked in, cancel it.<br>　　pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"<br>　　###</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">2、3、4、5</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">级别上以</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">ttyX</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">为参数执行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/sbin/mingetty</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序，打开</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">ttyX</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">终端用于用户登录，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><br>　　###</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">如果进程退出则再次运行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">mingetty</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">(respawn)<br>　　# Run gettys in standard runlevels<br>　　1:2345:respawn:/sbin/mingetty tty1<br>　　2:2345:respawn:/sbin/mingetty tty2<br>　　3:2345:respawn:/sbin/mingetty tty3<br>　　4:2345:respawn:/sbin/mingetty tty4<br>　　5:2345:respawn:/sbin/mingetty tty5<br>　　6:2345:respawn:/sbin/mingetty tty6<br>　　###</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">5</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">级别上运行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">xdm</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序，提供</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">xdm</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">图形方式登录界面，并在退出时重新执行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">(respawn)<br>　　# Run xdm in runlevel 5<br>　　x:5:respawn:/etc/X11/prefdm -nodaemon</span>
</p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">以上面的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">inittab</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">文件为例，来说明一下</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">inittab</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的格式</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">其中以</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">#</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">开始的行是注释行，除了注释行之外，每一行都有以下格式：</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"> <br>　　id:runlevel:action:process</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">　　</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">对上面各项的详细解释如下：</span></p>
<p style="TEXT-ALIGN: justify"><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><b>1. id</b></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">　　id</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">是指入口标识符，它是一个字符串，对于</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">getty</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">或</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">mingetty</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">等其他</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">login</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序项，要求</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">id</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">与</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">tty</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的编号相同，否则</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">getty</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序将不能正常工作</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。<br></span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><b>2. Runlevel</b></span></p>
<p style="TEXT-INDENT: 21pt; TEXT-ALIGN: justify"><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">runlevel</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">是</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">init</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">所处于的运行级别的标识，一般使用</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">0</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">－</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">6</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">以及</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">S</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">或</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">s。0、1、6</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">运行级别被系统保留：其中</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">0</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">作为</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">shutdown</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">动作，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">1</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">作为重启至单用户模式，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">6</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">为重启；</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">S</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">和</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">s</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">意义相同，表示单用户模式，且无需</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">inittab</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">文件，因此也不在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">inittab</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">中出现，实际上，进入单用户模式时，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">init</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">直接在控制台（</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/dev/console</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">）上运行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/sbin/sulogin。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">在一般的系统实现中，都使用了</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">2、3、4、5</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">几个级别，在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">CentOS</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">系统中，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">2</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">表示无</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">NFS</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">支持的多用户模式，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">3</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">表示完全多用户模式（也是最常用的级别），</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">4</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">保留给用户自定义，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">5</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">表示</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">XDM</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">图形登录方式</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。7</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">－</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">9</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">级别也是可以使用的，传统的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">Unix</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">系统没有定义这几个级别</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。runlevel</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">可以是并列的多个值，以匹配多个运行级别，对大多数</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">action</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">来说，仅当</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">runlevel</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">与当前运行级别匹配成功才会执行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。<br></span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><b>3. action</b></span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><br>　　action</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">是描述其后的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">process</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的运行方式的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。action</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">可取的值包括：</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">initdefault、sysinit、boot、bootwait</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">等：</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">　initdefault</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">是一个特殊的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">action</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">值，用于标识缺省的启动级别；当</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">init</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">由核心激活以后，它将读取</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">inittab</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">中的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">initdefault</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">项，取得其中的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">runlevel</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">，并作为当前的运行级别</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">如果没有</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">inittab</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">文件，或者其中没有</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">initdefault</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">项，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">init</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">将在控制台上请求输入</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">runlevel。　　sysinit、boot、bootwait</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">等</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">action</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">将在系统启动时无条件运行，而忽略其中的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">runlevel。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">其余的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">action</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">（不含</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">initdefault</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">）都与某个</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">runlevel</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">相关</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">各个</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">action</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的定义在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">inittab</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">man</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">手册中有详细的描述</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。<br></span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><b>4. process</b></span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><br>　　process</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">为具体的执行程序</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序后面可以带参数</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。&nbsp;</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Tips: </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">如果你看不懂这个文件，没有关系，随着你对</span><span
        style="FONT-SIZE: 10.5pt;">linux</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">的深入了解，你再回过头看这个文件你就会豁然开朗的</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">但是你现在必须要明白</span><span
        style="FONT-SIZE: 10.5pt;">runlevel</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">的各个级别的含义</span><span style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><b>C </b></span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'"><b>系统初始化</b></span></p>
<p style="TEXT-INDENT: 21pt; TEXT-ALIGN: justify"><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">init</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的配置文件中有这么一行：</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"> si::sysinit:/etc/rc.d/rc.sysinit　</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">它调用执行了</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/rc.d/rc.sysinit</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">，而</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">rc.sysinit</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">是一个</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">bash shell</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的脚本，它主要是完成一些系统初始化的工作，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">rc.sysinit</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">是每一个运行级别都要首先运行的重要脚本</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">它主要完成的工作有：激活交换分区，检查磁盘，加载硬件模块以及其它一些需要优先执行任务</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span></p>
<p style="TEXT-INDENT: 21pt; TEXT-ALIGN: justify"><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">rc.sysinit</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">约有</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">850</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">多行，但是每个单一的功能还是比较简单，而且带有注释，建议有兴趣的用户可以自行阅读自己机器上的该文件，以了解系统初始化所详细情况</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">由于此文件较长，所以不在本文中列出来，也不做具体的介绍</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">当</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">rc.sysinit</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序执行完毕后，将返回</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">init</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">继续下一步</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">通常接下来会执行到</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/rc.d/rc</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">以运行级别</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">3</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">为例，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">init</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">将执行配置文件</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">inittab</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">中的以下这行：</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><br>　　l5:5:wait:/etc/rc.d/rc 5<br>　</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">这一行表示以</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">5</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">为参数运行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/rc.d/rc</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/rc.d/rc</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">是一个</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">Shell</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">脚本，它接受</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">5</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">作为参数，去执行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/rc.d/rc5.d/</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">目录下的所有的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">rc</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">启动脚本，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/rc.d/rc5.d/</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">目录中的这些启动脚本实际上都是一些连接文件，而不是真正的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">rc</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">启动脚本，真正的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">rc</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">启动脚本实际上都是放在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/rc.d/init.d/</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">目录下</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">而这些</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">rc</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">启动脚本有着类似的用法，它们一般能接受</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">start、stop、restart、status</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">等参数</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span></p>
<p style="TEXT-INDENT: 21pt; TEXT-ALIGN: justify"><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/rc.d/rc5.d/</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">中的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">rc</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">启动脚本通常是</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">K</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">或</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">S</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">开头的连接文件，对于以以</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">S</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">开头的启动脚本，将以</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">start</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">参数来运行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">而如果发现存在相应的脚本也存在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">K</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">打头的连接，而且已经处于运行态了</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">(</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">以</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/var/lock/subsys/</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">下的文件作为标志</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">)</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">，则将首先以</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">stop</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">为参数停止这些已经启动了的守护进程，然后再重新运行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">这样做是为了保证是当</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">init</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">改变运行级别时，所有相关的守护进程都将重启</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span></p>
<p style="TEXT-INDENT: 21pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">至于在每个运行级中将运行哪些守护进程，用户可以通过</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">chkconfig</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">或</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">setup</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">中的</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">"System Services"</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">来自行设定</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span></p>
<p style="TEXT-ALIGN: justify"><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><b>D </b></span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'"><b>建立终端</b></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">rc</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">执行完毕后，返回</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">init。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">这时基本系统环境已经设置好了，各种守护进程也已经启动了</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。init</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">接下来会打开</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">6</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">个终端，以便用户登录系统</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">inittab</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">中的以下</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">6</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">行就是定义了</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">6</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">个终端：</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><br>　　1:2345:respawn:/sbin/mingetty tty1<br>　　2:2345:respawn:/sbin/mingetty tty2<br>　　3:2345:respawn:/sbin/mingetty tty3<br>　　4:2345:respawn:/sbin/mingetty tty4<br>　　5:2345:respawn:/sbin/mingetty tty5<br>　　6:2345:respawn:/sbin/mingetty tty6<br>　<br>　</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">从上面可以看出在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">2、3、4、5</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的运行级别中都将以</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">respawn</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">方式运行</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">mingetty</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">mingetty</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序能打开终端</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">、</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">设置模式</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">同时它会显示一个文本登录界面，这个界面就是我们经常看到的登录界面，在这个登录界面中会提示用户输入用户名，而用户输入的用户将作为参数传给</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">login</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序来验</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'"><br></span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">证用户的身份</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><b>E </b></span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'"><b>用户登录系统</b></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"></span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">对于运行级别为</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">5</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的图形方式用户来说，他们的登录是通过一个图形化的登录界面</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">登录成功后可以直接进入</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">KDE、Gnome</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">等窗口管理器</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">而本文主要讲的还是文本方式登录的情况：当我们看到</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">mingetty</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的登录界面时，我们就可以输入用户名和密码来登录系统了</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span></p>
<p style="TEXT-INDENT: 21pt; TEXT-ALIGN: justify"><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">Linux</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的账号验证程序是</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">login</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">login</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">会接收</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">mingetty</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">传来的用户名作为用户名参数</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">然后</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">login</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">会对用户名进行分析：如果用户名不是</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">root</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">，且存在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/nologin</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">文件，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">login</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">将输出</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">nologin</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">文件的内容，然后退出</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">这通常用来系统维护时防止非</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">root</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">用户登录</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">只有</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/securetty</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">中登记了的终端才允许</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">root</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">用户登录，如果不存在这个文件，则</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">root</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">可以在任何终端上登录</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。/etc/usertty</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">文件用于对用户作出附加访问限制，如果不存在这个文件，则没有其他限制</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。</span></p>
<p style="TEXT-INDENT: 21pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">在分析完用户名后，</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">login</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">将搜索</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/passwd</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">以及</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/shadow</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">来验证密码以及设置账户的其它信息，比如：主目录是什么</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">、</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">使用何种</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">shell。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">如果没有指定主目录，将默认为根目录；如果没有指定</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">shell</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">，将默认为</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/bin/bash。</span></p>
<p style="TEXT-INDENT: 21pt; TEXT-ALIGN: justify"><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">login</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">程序成功后，会向对应的终端在输出最近一次登录的信息</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">(</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/var/log/lastlog</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">中有记录</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">)</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">，并检查用户是否有新邮件</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">(</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/usr/spool/mail/</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">的对应用户名目录下</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">)。</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">然后开始设置各种环境变量：对于</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">bash</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">来说，系统首先寻找</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">/etc/profile</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">脚本文件，并执行它；然后如果用户的主目录中存在</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">.bash_profile</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: '宋体'">文件，就执行它，在这些文件中又可能调用了其它配置文件，所有的配置文件执行后后，各种环境变量也设好了，这时会出现大家熟悉的命令行提示符，到此整个启动过程就结束了</span><span
        style="FONT-SIZE: 9.5pt; COLOR: #000000; FONT-FAMILY: 'Verdana'">。&nbsp;</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">【</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'"><b>图形模式与文字模式的切换方式</b></span><span
        style="FONT-SIZE: 10.5pt;">】</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Linux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">预设提供了六个命令窗口终端机让我们来登录</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">默认我们登录的就是第一个窗口，也就是</span><span
        style="FONT-SIZE: 10.5pt;">tty1</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">，这个六个窗口分别为</span><span
        style="FONT-SIZE: 10.5pt;">tty1,tty2 … tty6</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">，你可以按下</span><span
        style="FONT-SIZE: 10.5pt;">Ctrl + Alt + F1 ~ F6 </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">来切换它们</span><span style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">如果你安装了图形界面，默认情况下是进入图形界面的，此时你就可以按</span><span
        style="FONT-SIZE: 10.5pt;">Ctrl + Alt + F1 ~ F6</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">来进入其中一个命令窗口界面</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">当你进入命令窗口界面后再返回图形界面只要按下</span><span style="FONT-SIZE: 10.5pt;">Ctrl + Alt + F7 </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">就回来了</span><span style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">如果你用的</span><span style="FONT-SIZE: 10.5pt;">vmware </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">虚拟机，命令窗口切换的快捷键为</span><span
        style="FONT-SIZE: 10.5pt;"> </span><span style="FONT-SIZE: 9.5pt;">Alt + Space + F1~F6. </span><span
        style="FONT-SIZE: 9.5pt; FONT-FAMILY: '宋体'">如果你在图形界面下请按</span><span style="FONT-SIZE: 9.5pt;">Alt + Shift + Ctrl + F1~F6 </span><span
        style="FONT-SIZE: 9.5pt; FONT-FAMILY: '宋体'">切换至命令窗口</span><span style="FONT-SIZE: 9.5pt;">。&nbsp;</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">【</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'"><b>学会使用快捷键</b></span><span style="FONT-SIZE: 10.5pt;">】</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">Ctrl + C：这个是用来终止当前命令的快捷键，当然你也可以输入一大串字符，不想让它运行直接Ctrl + C，光标就会跳入下一行。&nbsp;</span>
</p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Tab</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">：</span><span style="FONT-SIZE: 10.5pt;"> </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个键是最有用的键了，也是笔者敲击概率最高的一个键</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">因为当你打一个命令打一半时，它会帮你补全的</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">不光是命令，当你打一个目录时，同样可以补全，不信你试试</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="MARGIN-LEFT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"></span>&nbsp;</p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Ctrl + D</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">：</span><span style="FONT-SIZE: 10.5pt;"> </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">退出当前终端，同样你也可以输入</span><span style="FONT-SIZE: 10.5pt;">exit。</span>
</p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Ctrl + Z</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">：</span><span style="FONT-SIZE: 10.5pt;"> </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">暂停当前进程，比如你正运行一个命令，突然觉得有点问题想暂停一下，就可以使用这个快捷键</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">暂停后，可以使用</span><span
        style="FONT-SIZE: 10.5pt;">fg </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">恢复它</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Ctrl + L</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">：</span><span style="FONT-SIZE: 10.5pt;"> </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">清屏，使光标移动到第一行</span><span style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"></span>&nbsp;</p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">【</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'"><b>学会查询帮助文档</b></span><span
        style="FONT-SIZE: 10.5pt;"><b> — man</b></span><span style="FONT-SIZE: 10.5pt;">】</span></p>
<p style="MARGIN-LEFT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个</span><span
        style="FONT-SIZE: 10.5pt;">man </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">通常是用来看一个命令的帮助文档的</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">例如：</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_1.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">输入</span><span
        style="FONT-SIZE: 10.5pt;"> man ls </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">其实格式为</span><span
        style="FONT-SIZE: 10.5pt;"> man + </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">命令</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">你就会看到相关的帮助文档了</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">从命令的介绍到命令的参数以及用法介绍的都非常详细的</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">不错吧</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"></span>&nbsp;</p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">【</span><span
        style="FONT-SIZE: 10.5pt;"><b>Linux</b></span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'"><b>系统目录结构</b></span><span style="FONT-SIZE: 10.5pt;">】</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">登录系统后，在当前命令窗口下输入</span><span
        style="FONT-SIZE: 10.5pt;"> ls / </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">你会看到</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_20.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">以下是对这些目录的解释：</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/bin bin</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">是</span><span style="FONT-SIZE: 10.5pt;">Binary</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">的缩写</span><span style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个目录存放着最经常使用的命令</span><span style="FONT-SIZE: 10.5pt;">。 </span>
</p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/boot</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这里存放的是启动</span><span style="FONT-SIZE: 10.5pt;">Linux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">时使用的一些核心文件，包括一些连接文件以及镜像文件</span><span
        style="FONT-SIZE: 10.5pt;">。 </span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/dev dev</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">是</span><span style="FONT-SIZE: 10.5pt;">Device(</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">设备</span><span style="FONT-SIZE: 10.5pt;">)</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">的缩写</span><span style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">该目录下存放的是</span><span style="FONT-SIZE: 10.5pt;">Linux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">的外部设备，在</span><span style="FONT-SIZE: 10.5pt;">Linux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">中访问设备的方式和访问文件的方式是相同的</span><span
        style="FONT-SIZE: 10.5pt;">。 </span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/etc</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个目录用来存放所有的系统管理所需要的配置文件和子目录</span><span style="FONT-SIZE: 10.5pt;">。 </span>
</p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/home</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">用户的主目录，在</span><span style="FONT-SIZE: 10.5pt;">Linux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">中，每个用户都有一个自己的目录，一般该目录名是以用户的账号命名的</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/lib</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个目录里存放着系统最基本的动态连接共享库，其作用类似于</span><span
        style="FONT-SIZE: 10.5pt;">Windows</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">里的</span><span
        style="FONT-SIZE: 10.5pt;">DLL</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">文件</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">几乎所有的应用程序都需要用到这些共享库</span><span
        style="FONT-SIZE: 10.5pt;">。 </span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/lost+found</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个目录一般情况下是空的，当系统非法关机后，这里就存放了一些文件</span><span
        style="FONT-SIZE: 10.5pt;">。 </span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/media linux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">系统会自动识别一些设备，例如</span><span style="FONT-SIZE: 10.5pt;">U</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">盘</span><span style="FONT-SIZE: 10.5pt;">、</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">光驱等等，当识别后，</span><span style="FONT-SIZE: 10.5pt;">linux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">会把识别的设备挂载到这个目录下</span><span style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/mnt</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">系统提供该目录是为了让用户临时挂载别的文件系统的，我们可以将光驱挂载在</span><span
        style="FONT-SIZE: 10.5pt;">/mnt/</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">上，然后进入该目录就可以查看光驱里的内容了</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/opt </span><span
        style="FONT-SIZE: 9.5pt; FONT-FAMILY: '宋体'">这是给主机额外安装软件所摆放的目录</span><span
        style="FONT-SIZE: 9.5pt; FONT-FAMILY: 'Arial'">。</span><span
        style="FONT-SIZE: 9.5pt; FONT-FAMILY: '宋体'">比如你安装一个</span><span style="FONT-SIZE: 9.5pt; FONT-FAMILY: 'Arial'">ORACLE</span><span
        style="FONT-SIZE: 9.5pt; FONT-FAMILY: '宋体'">数据库则就可以放到这个目录下</span><span
        style="FONT-SIZE: 9.5pt; FONT-FAMILY: 'Arial'">。</span><span
        style="FONT-SIZE: 9.5pt; FONT-FAMILY: '宋体'">默认是空的</span><span
        style="FONT-SIZE: 9.5pt; FONT-FAMILY: 'Arial'">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/proc</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个目录是一个虚拟的目录，它是系统内存的映射，我们可以通过直接访问这个目录来获取系统信息</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个目录的内容不在硬盘上而是在内存里，我们也可以直接修改里面的某些文件，比如可以通过下面的命令来屏蔽主机的</span><span
        style="FONT-SIZE: 10.5pt;">ping</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">命令，使别人无法</span><span
        style="FONT-SIZE: 10.5pt;">ping</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">你的机器：</span><span
        style="FONT-SIZE: 10.5pt;"> </span></p>
<p style="TEXT-ALIGN: justify"><span
        style="FONT-SIZE: 10.5pt;">echo 1 &gt; /proc/sys/net/ipv4/icmp_echo_ignore_all。 </span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/root</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">该目录为系统管理员，也称作超级权限者的用户主目录</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/sbin s</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">就是</span><span style="FONT-SIZE: 10.5pt;">Super User</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">的意思，这里存放的是系统管理员使用的系统管理程序</span><span
        style="FONT-SIZE: 10.5pt;">。 </span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/selinux </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个目录是</span><span
        style="FONT-SIZE: 10.5pt;">Redhat/CentOS</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">所特有的目录，</span><span
        style="FONT-SIZE: 10.5pt;">Selinux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">是一个安全机制，类似于</span><span
        style="FONT-SIZE: 10.5pt;">windows</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">的防火墙，但是这套机制比较复杂，这个目录就是存放</span><span
        style="FONT-SIZE: 10.5pt;">selinux</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">相关的文件的</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/srv </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">该目录存放一些服务启动之后需要提取的数据</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/sys </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这是</span><span style="FONT-SIZE: 10.5pt;">linux2.6</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">内核的一个很大的变化</span><span style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">该目录下安装了</span><span style="FONT-SIZE: 10.5pt;">2.6</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">内核中新出现的一个文件系统</span><span style="FONT-SIZE: 10.5pt;"> sysfs </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">，</span><span style="FONT-SIZE: 10.5pt;">sysfs</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">文件系统集成了下面</span><span style="FONT-SIZE: 10.5pt;">3</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">种文件系统的信息：针对进程信息的</span><span style="FONT-SIZE: 10.5pt;">proc</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">文件系统</span><span style="FONT-SIZE: 10.5pt;">、</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">针对设备的</span><span style="FONT-SIZE: 10.5pt;">devfs</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">文件系统以及针对伪终端的</span><span
        style="FONT-SIZE: 10.5pt;">devpts</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">文件系统</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">该文件系统是内核设备树的一个直观反映</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">当一个内核对象被创建的时候，对应的文件和目录也在内核对象子系统种被创建</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/tmp</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个目录是用来存放一些临时文件的</span><span style="FONT-SIZE: 10.5pt;">。 </span>
</p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/usr </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这是一个非常重要的目录，用户的很多应用程序和文件都放在这个目录下，类似与</span><span
        style="FONT-SIZE: 10.5pt;">windows</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">下的</span><span
        style="FONT-SIZE: 10.5pt;">program files</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">目录</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/usr/bin</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">：系统用户使用的应用程序</span><span style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/usr/sbin</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">：超级用户使用的比较高级的管理程序和系统守护程序</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/usr/src</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">：内核源代码默认的放置目录</span><span style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">/var</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个目录中存放着在不断扩充着的东西，我们习惯将那些经常被修改的目录放在这个目录下</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">包括各种日志文件</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"></span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">在</span><span style="FONT-SIZE: 10.5pt;">linux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">系统中，有几个目录是比较重要的，平时需要注意不要误删除或者随意更改内部文件</span><span
        style="FONT-SIZE: 10.5pt;">。/etc</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">：</span><span
        style="FONT-SIZE: 10.5pt;"> </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">上边也提到了，这个是系统中的配置文件，如果你更改了该目录下的某个文件可能会导致系统不能启动</span><span
        style="FONT-SIZE: 10.5pt;">。/bin, /sbin, /usr/bin, /usr/sbin: </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这是系统预设的执行文件的放置目录，比如</span><span
        style="FONT-SIZE: 10.5pt;"> ls </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">就是在</span><span
        style="FONT-SIZE: 10.5pt;">/bin/ls </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">目录下的</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">值得提出的是，</span><span
        style="FONT-SIZE: 10.5pt;">/bin, /usr/bin </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">是给系统用户使用的指令（除</span><span
        style="FONT-SIZE: 10.5pt;">root</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">外的通用户），而</span><span
        style="FONT-SIZE: 10.5pt;">/sbin, /usr/sbin </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">则是给</span><span
        style="FONT-SIZE: 10.5pt;">root</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">使用的指令</span><span
        style="FONT-SIZE: 10.5pt;">。 /var</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">：</span><span
        style="FONT-SIZE: 10.5pt;"> </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这是一个非常重要的目录，系统上跑了很多程序，那么每个程序都会有相应的日志产生，而这些日志就被记录到这个目录下，具体在</span><span
        style="FONT-SIZE: 10.5pt;">/var/log </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">目录下，另外</span><span
        style="FONT-SIZE: 10.5pt;">mail</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">的预设放置也是在这里</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"></span>&nbsp;</p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">【</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'"><b>如何正确关机</b></span><span style="FONT-SIZE: 10.5pt;">】</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">其实，在</span><span
        style="FONT-SIZE: 10.5pt;">linux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">领域内大多用在服务器上，很少遇到关机的操作</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">毕竟服务器上跑一个服务是永无止境的，除非特殊情况下，不得已才会关机</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">linux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">和</span><span style="FONT-SIZE: 10.5pt;">windows</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">不同，在</span><span style="FONT-SIZE: 10.5pt;"> Linux </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">底下，由于每个程序（或者说是服务）都是在在背景下执行的，因此，在你看不到的屏幕背后其实可能有相当多人同时在你的主机上面工作，例如浏览网页啦</span><span
        style="FONT-SIZE: 10.5pt;">、</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">传送信件啦以</span><span
        style="FONT-SIZE: 10.5pt;"> FTP </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">传送档案啦等等的，如果你直接按下电源开关来关机时，则其它人的数据可能就此中断！那可就伤脑筋了！此外，最大的问题是，若不正常关机，则可能造成文件系统的毁损（因为来不及将数据回写到档案中，所以有些服务的档案会有问题！）</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">如果你要关机，必须要保证当前系统中没有其他用户在线</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">可以下达</span><span
        style="FONT-SIZE: 10.5pt;"> who </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个指令，而如果要看网络的联机状态，可以下达</span><span style="FONT-SIZE: 10.5pt;"> netstat -a </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个指令，而要看背景执行的程序可以执行</span><span
        style="FONT-SIZE: 10.5pt;"> ps -aux </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个指令</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">使用这些指令可以让你稍微了解主机目前的使用状态！（这些命令在以后的章节中会提及，现在只要了解即可！）</span>
</p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">正确的关机流程为：</span><span style="FONT-SIZE: 10.5pt;">sysnc </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Wingdings'">?</span><span
        style="FONT-SIZE: 10.5pt;"> shutdown </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Wingdings'">?</span><span
        style="FONT-SIZE: 10.5pt;"> reboot </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: 'Wingdings'">?</span><span style="FONT-SIZE: 10.5pt;"> halt</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">sync </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">将数据由内存同步到硬盘中</span><span style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">shutdown </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">关机指令，你可以</span><span
        style="FONT-SIZE: 10.5pt;">man shutdown </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">来看一下帮助文档</span><span style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">例如你可以运行如下命令关机：</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">shutdown –h 10 ‘This server will shutdown after 10 mins’ </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个命令告诉大家，计算机将在</span><span
        style="FONT-SIZE: 10.5pt;">10</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">分钟后关机，并且会显示在登陆用户的当前屏幕中</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Shutdown –h now </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">立马关机</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Shutdown –h 20:25 </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">系统会在今天</span><span style="FONT-SIZE: 10.5pt;">20:25</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">关机</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Shutdown –h +10 </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">十分钟后关机</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Shutdown –r now </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">系统立马重启</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Shutdown –r +10 </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">系统十分钟后重启</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">reboot </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">就是重启，等同于</span><span
        style="FONT-SIZE: 10.5pt;"> shutdown –r now </span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">halt </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">关闭系统，等同于</span><span
        style="FONT-SIZE: 10.5pt;">shutdown –h now </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">和</span><span style="FONT-SIZE: 10.5pt;"> poweroff </span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"></span>&nbsp;</p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">最后总结一下，不管是重启系统还是关闭系统，首先要运行</span><span
        style="FONT-SIZE: 10.5pt;">sync</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">命令，把内存中的数据写到磁盘中</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">关机的命令有</span><span
        style="FONT-SIZE: 10.5pt;"> shutdown –h now halt poweroff </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">和</span><span style="FONT-SIZE: 10.5pt;"> init 0 , </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">重启系统的命令有</span><span style="FONT-SIZE: 10.5pt;"> shutdown –r now reboot init 6.</span>
</p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"></span>&nbsp;</p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">【</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'"><b>忘记</b></span><span style="FONT-SIZE: 10.5pt;"><b>root</b></span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'"><b>密码如何做</b></span><span style="FONT-SIZE: 10.5pt;">】</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">以前笔者忘记</span><span
        style="FONT-SIZE: 10.5pt;">windows</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">的管理员密码，由于不会用光盘清除密码最后只能重新安装系统</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">现在想想那是多么愚笨的一件事情</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">同样</span><span
        style="FONT-SIZE: 10.5pt;">linux</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">系统你也会遇到忘记</span><span
        style="FONT-SIZE: 10.5pt;">root</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">密码的情况，如果遇到这样的情况怎么办呢？重新安装系统吗？当然不用！进入单用户模式更改一下</span><span
        style="FONT-SIZE: 10.5pt;">root</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">密码即可</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">如何进入呢</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">1 </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">重启</span><span style="FONT-SIZE: 10.5pt;">linux</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">系统</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_21.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">3 </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">秒之内要按一下回车，出现如下界面</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_22.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">然后输入</span><span
        style="FONT-SIZE: 10.5pt;">e</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_23.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">在</span><span
        style="FONT-SIZE: 10.5pt;"> </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">第二行最后边输入</span><span
        style="FONT-SIZE: 10.5pt;"> single</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">，有一个空格</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">具体方法为按向下尖头移动到第二行，按</span><span
        style="FONT-SIZE: 10.5pt;">“e”</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">进入编辑模式</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_24.png">回车</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_25.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">最后按</span><span
        style="FONT-SIZE: 10.5pt;">“b”</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">启动，启动后就进入了单用户模式了</span>
</p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_26.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">此时已经进入到单用户模式了，你可以更改</span><span
        style="FONT-SIZE: 10.5pt;">root</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">密码了</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">更密码的命令为</span><span
        style="FONT-SIZE: 10.5pt;"> passwd</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_27.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"></span>&nbsp;</p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">【</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'"><b>使用系统安装光盘的救援模式</b></span><span
        style="FONT-SIZE: 10.5pt;">】</span></p>
<p style="TEXT-INDENT: 18pt; TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">救援模式即</span><span
        style="FONT-SIZE: 10.5pt;">rescue </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">，这个模式主要是应用于，系统无法进入的情况</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">如，</span><span
        style="FONT-SIZE: 10.5pt;">grub</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">损坏或者某一个配置文件修改出错</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">如何使用</span><span
        style="FONT-SIZE: 10.5pt;">rescue</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">模式呢？</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">光盘启动，按</span><span
        style="FONT-SIZE: 10.5pt;">F5 </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">进入</span><span
        style="FONT-SIZE: 10.5pt;">rescue</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">模式</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_28.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">输入</span><span
        style="FONT-SIZE: 10.5pt;">linux rescue </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">回车</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_29.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">选择语言，笔者建议你选择英语</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_30.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">选择</span><span
        style="FONT-SIZE: 10.5pt;">us </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">键盘</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_31.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_32.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这里问你是否启动网络，有时候可能会联网调试</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">我们选</span><span
        style="FONT-SIZE: 10.5pt;">no</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_33.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这里告诉我们，接下来会把系统挂载在</span><span
        style="FONT-SIZE: 10.5pt;">/mnt/sysimage </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">中</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">其中有三个选项，</span><span
        style="FONT-SIZE: 10.5pt;">Continue </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">就是挂载后继续下一步；</span><span
        style="FONT-SIZE: 10.5pt;"> Read-Only </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">挂载成只读，这样更安全，有时文件系统损坏时，只读模式会防止文件系统近一步损坏；</span><span
        style="FONT-SIZE: 10.5pt;">Skip</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">就是不挂载，进入一个命令窗口模式</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这里我们选择</span><span
        style="FONT-SIZE: 10.5pt;">Continue。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_34.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">至此，系统已经挂载到了</span><span
        style="FONT-SIZE: 10.5pt;">/mnt/sysimage</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">中</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">接下来回车，输入</span><span
        style="FONT-SIZE: 10.5pt;">chroot /mnt/sysimage </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">进入管理员环境</span><span
        style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_35.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;">Tips</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">：</span><span style="FONT-SIZE: 10.5pt;"> </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">其实也可以到</span><span style="FONT-SIZE: 10.5pt;">rescue</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">模式下更改</span><span style="FONT-SIZE: 10.5pt;">root</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">的密码的</span><span style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个</span><span style="FONT-SIZE: 10.5pt;">rescue</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">模式和</span><span style="FONT-SIZE: 10.5pt;">windows PE</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">系统很相近</span><span style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">当运行了</span><span
        style="FONT-SIZE: 10.5pt;">chroot /mnt/sysimage/ </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">后，再</span><span style="FONT-SIZE: 10.5pt;">ls </span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">看到目录结构和原来系统中的目录结构是一样的</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">没错！现在的环境和原来系统的环境是一模一样的</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">你可以输入</span><span
        style="FONT-SIZE: 10.5pt;">exit </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">或者按</span><span
        style="FONT-SIZE: 10.5pt;">Ctrl + D</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">退出这个环境</span><span
        style="FONT-SIZE: 10.5pt;">。</span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">然后你再</span><span
        style="FONT-SIZE: 10.5pt;">ls </span><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">看一下</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt;"><img alt="[image]" src="4_36.png"></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">这个目录其实就是</span><span
        style="FONT-SIZE: 10.5pt;">rescue</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">模式下的目录结构，而我们的系统文件全部在</span><span style="FONT-SIZE: 10.5pt;"> /mnt/sysimage</span><span
        style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">目录下</span><span style="FONT-SIZE: 10.5pt;">。</span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">上一页 <a
        href="3.htm">Linux操作系统的安装</a></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'">下一页 <a
        href="5.htm">Linux系统的远程登录</a></span></p>
<p style="TEXT-ALIGN: justify"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: '宋体'"><a
        href="index.htm">回到主目录</a>&nbsp;</span></p>

</body>
</html>